$(function(){
	var data = {
			url:path+'/repository/storagePosition',
			columns: [{
				field: 'checked',
				checkbox: true,
			}, {
				field: 'stgPosId',
				visible: false
			}, {
				field: 'stgPosMark',
				title: '位置编号'
			}, {
				field: 'stgPosNature',
				title: '性质'
			}, {
				field: 'stgPosLength',
				title: '长度',
				sortable: true
			}, {
				field: 'stgPosWidth',
				title: '宽度',
				sortable: true
			}, {
				field: 'stgPosStatus',
				title: '状态',
				formatter: function (value, row, index) {
					switch(value){
						case "可存放":
							return "<span class='layui-badge layui-bg-green'>可存放</span>"
						case "少量存放":
							return "<span class='layui-badge layui-bg-orange'>少量存放</span>"
						case "无法存放":
							return "<span class='layui-badge'>无法存放</span>"
					}
				}
			}, {
				field: 'stgPosLayer',
				title: '层数'
			}, {
				field: 'stgPosRemark',
				title: '备注'
			}],	
			method: 'GET',//请求方式（*）
			contentType : "application/x-www-form-urlencoded;charset='UTF-8'", //加上这个才可以接收到值
			sortable: true,
			sortOrder: "asc",
			search: false,
			exportOptions:{  
			   fileName: '仓库货架信息'+exportDate.toLocaleString(),//文件名称设置  
			   worksheetName: 'sheet1',//表格工作区名称  
			   tableName: '仓库货架信息',
				           ignoreColumn: [0,1],
						   unaffectedColumn:0
			}
	}
		  
	var param = [{text:"货架性质",name:"stgPosNature",type:"text",verify:"chineseStr"},{text:"货架状态",name:"stgPosStatus",type:"select",verify:"",option:[{key:"可存放",value:"可存放"},{key:"少量存放",value:"少量存放"},{key:"无法存放",value:"无法存放"}]}];
	
	createQueryPanel(param);
	
	renderTable(cTable,data);

	form.render();
})

//添加按钮
$("#add_btn").click(function(){
	openOperateWindow({
		title: "存放位添加",
		url: "/admin/enterpriseManagement/repositoryManagement/storagePosition/storage-position-add.jsp"
	})
})

//删除按钮
$("#remove_btn").click(function(){
	//fixedAlert("抱歉!这里不允许直接删除货架,需要删除请到货物盘点中去删除",0);
	requestRemoveData("stgPosId","/repository/storagePosition");
})

//修改按钮
$("#modify_btn").click(function(){
	openOperateWindow({
		title: "存放位更新",
		isUpdate: true,
		url: "/admin/enterpriseManagement/repositoryManagement/storagePosition/storage-position-update.jsp"
	})
})

